import axios from '@/utils/request'
// 获取分类列表
export function categories(params) {
  return axios({
    url: '/categories',
    // method:'get'
    params
  })
}

// 删除
export function delEmployee(id) {
  return axios({
    url: `/categories/${id}`,
    method: 'delete'
  })
}

// 指定分类
export function compile(id) {
  return axios({
    url: `/categories/${id}`,
    method: 'put'
  })
}

// 新增
export function addition(data) {
  return axios({
    url: '/categories',
    method: 'post',
    data
  })
}

// 编辑
export function compileFn(data) {
  return axios({
    url: `/categories/${data.id}`,
    method: 'put',
    data
  })
}

// 分页
export function categoriesCount(params) {
  return axios({
    url: '/categories/count',
    params
  })
}
